{layout name="public::layout" /}

<h4 class="text-center text-success">用户列表</h4>

<table class="table table-default table-striped table-bordered table-hover text-center">
    <tr>
        <td>ID</td>
        <td>用户名</td>
        <td>邮箱</td>
        <td>手机号</td>
        <td>注册时间</td>
        <td>身份</td>
        <td>状态</td>
        <td colspan="2">操作</td>
    </tr>
    {volist name="userList" id="user" empty="$empty"}
    <tr>
        <td>{$user.id}</td>
        <td>{$user.name}</td>
        <td>{$user.email}</td>
        <td>{$user.mobile}</td>
        <td>{$user.create_time}</td>
        <td>{$user.is_admin|getIsAdmin}</td>
        <td>{$user.status}</td>
        {eq name="$user.id" value="$Think.session.admin_id"}
        <td><a href="{:url('user/userEdit',['id'=>$user.id])}">编辑</a></td>
        {/eq}
        {neq name="$user.id" value="$Think.session.admin_id"}
<!--        <td><a href="javascript:;" onclick="dele()">删除</a></td>-->
<!--        <td><a href="" onclick="dele(); return false">删除</a></td>-->
        <td><a href="{:url('user/doDelete',['id'=>$user.id])}" onclick="dele();">删除</a></td>
<!--        <td><a href="{:url('user/userDelete',['id'=>$user.id])}" onclick="dele();">删除</a></td>-->
        {/neq}
    </tr>
    {/volist}
</table>

<script>
    function dele() {
        // alert({$user.id});
        if (confirm('您是真的要删除吗？') == true){
            window.location.href = "{:url('user/doDelete',['id'=>$user.id])}";
        }
    }
</script>